//全局批量注册components下所有组件
export default {
  install(Vue) {
    /*webpack写法
      let allCom = require.context('./', false, /\.vue$/) 
      */
    let allCom = import.meta.globEager('./*.vue')
    Object.keys(allCom).forEach((item) => {
      const component = allCom[item].default
      Vue.component(item.replace(/\.\//, '').replace(/\.vue$/, ''), component)
    })
  }
}
